#include "imageset.h"
#include "invoker.h"
#include "export.h"

int main()
{
	Imageset* is = imageset_new();
	Image* img = imageset_addimage(is, 12, 8, "test");
	Invoker* ivk = invoker_new(img);
	Command cmd1 = { CMD_SET_PIXEL, .sp = { 0, 0, BLACK } };
	Command cmd2 = { CMD_SET_PIXEL, .sp = { 1, 1, BLACK } };
	Command cmd3 = { CMD_SET_PIXEL, .sp = { 2, 1, BLACK } };
	invoker_execute(ivk, &cmd1);
	invoker_execute(ivk, &cmd2);
	invoker_execute(ivk, &cmd3);
	//invoker_undo(ivk);
	//invoker_undo(ivk);
	//invoker_undo(ivk);
/*
	FILE *f = fopen("teste.txt", "r");
	Imageset* is = imageset_input(f);
	fclose(f);
*/
	imageset_output(is, stdout);
	printf("%d\n", image_export_png(img, "test.png"));

	imageset_delete(is);
	invoker_delete(ivk);
	return 0;
}
